#include "config_fw.h"
#include "mmpf_typedef.h"
#include "mmpf_pll.h"
#include "mmp_reg_gbl.h"
#include "mmp_reg_gpio.h"

#include "lib_retina.h"

void USB_EnableTaskRunning(MMP_UBYTE en);
void MMPF_SaveDefClock(MMP_ULONG clk) ;
void MMPF_RestoreDefClock(void) ;

static MMP_ULONG glDefSysClock ;

void MMPF_SaveDefClock(MMP_ULONG clk) 
{
    glDefSysClock = clk ;
    RTNA_DBG_Str3("Def Init Clk:");
    RTNA_DBG_Long3(glDefSysClock);
    RTNA_DBG_Str3("\r\n");
}

void MMPF_RestoreDefClock(void)
{
    //AITPS_GBL   pGBL = AITC_BASE_GBL;
    //T.B.D for VSN_V2,  pGBL->GBL_CLK_EN = glDefSysClock ;
    RTNA_DBG_Str3("Restore Init Clk:");
    //RTNA_DBG_Long3(pGBL->GBL_CLK_EN);
    RTNA_DBG_Str3("\r\n");
}



#pragma O0
extern MMP_UBYTE gbUSBSuspendFlag ;
#pragma

volatile AITPS_TC    pTC0_ITCM = AITC_BASE_TC0;

//
// Enable\Disable OS running by set Timer intr.
//
void USB_EnableTaskRunning(MMP_UBYTE en)
{
    if(en) {
        RTNA_TC_IRQ_En(pTC0_ITCM, TC_CPCS);
    } else {
        RTNA_TC_IRQ_Dis(pTC0_ITCM, TC_CPCS);
    }
}

